package cn.stacey.offer01;

import java.util.Scanner;

public class tianshu {
	public static void main(String[] args) {
		int count=0;
		int days=0;
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入年：");
		int year=sc.nextInt();
		System.out.println("请输入月：");
		int month=sc.nextInt();
		System.out.println("请输入日：");
		int day=sc.nextInt();
		for(int i=1;i<month;i++) {
			switch(i) {			
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
			days=31;
			break;			
			case 4:
			case 6:
			case 9:
			case 11:
			days=30;
			break;
			case 2:{
				if((year%4==0&&year%100!=0)||year%400==0) {
//					count+=29;
					days=29;
				}else {
//					count+=28;
					days=28;
				}
			}
			break;	
			
			}
//			count+=day;
			count+=days;
			
		}
		count+=day;
		System.out.println(year+"年"+month+"月"+day+"天是这一年的第"+count+"天");
		
		
		
		
	}
}
